package com.cadre.web.controller.tool;

import com.cadre.system.domain.officer.A19;
import org.springframework.util.ClassUtils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

/* loaded from: TestTextUtil.class */
public class TestTextUtil {
    public static void writeFile(List<A19> a19List) throws IOException {
        String resultpath = ClassUtils.getDefaultClassLoader().getResource("").getPath() + "/worddic_result.txt";
        System.out.println("result path:" + resultpath);
        File resultFile = new File(resultpath);
        try {
            resultFile.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
        BufferedWriter out = new BufferedWriter(new FileWriter(resultFile));
        int i = 0;
        while (i < a19List.size()) {
            try {
                int i2 = i + 1;
                out.write(i + a19List.get(i2).toString() + "\r\n");
                i = i2 + 1;
            } catch (IOException e2) {
                e2.printStackTrace();
                return;
            }
        }
        out.flush();
    }
}
